<template>
  <div class="filter-container">
    <el-button class="filter-item" type="primary" icon="el-icon-circle-plus-outline" @click="getThis">领取</el-button>
    <el-table :data="list" v-loading="listLoading" empty-text="目前无可领取项目" element-loading-text="给我一点时间" border fit highlight-current-row
        style="width: 100%" max-height="580" @selection-change="handleSelectionChange">
      <el-table-column type="selection" align="center" label="选择" width="65">
      </el-table-column>
      <el-table-column width="220px" align="center" label="订单编号">
        <template slot-scope="scope">
          <span>{{scope.row.order_num}}</span>
        </template>
      </el-table-column>
      <el-table-column min-width="180px" align="center" label="计划名称">
        <template slot-scope="scope">
          <span>{{scope.row.name}}</span>
        </template>
      </el-table-column>
      <el-table-column width="150px" align="center" label="上次审核人">
        <template slot-scope="scope">
          <span>{{scope.row.lastcheckperson}}</span>
        </template>
      </el-table-column>
      <el-table-column width="150px" align="center" label="缴费方法">
        <template slot-scope="scope">
          <span v-if="scope.row.price">{{scope.row.pay_type_text}}</span>
          <span v-else>无</span>
        </template>
      </el-table-column>
      <el-table-column align="center" label="优惠政策" width="150">
        <template slot-scope="scope">
          <span v-if="scope.row.price">{{scope.row.favor_type_text}}</span>
          <span v-else>无</span>
        </template>
      </el-table-column>
      <el-table-column class-name="status-col" label="订单总额" width="150">
        <template slot-scope="scope">
          <el-tag type="success">{{scope.row.price_text}}</el-tag>
        </template>
      </el-table-column>
      <el-table-column align="center" label="进审时间" width="220" class-name="small-padding">
        <template slot-scope="scope">
          <span>{{scope.row.start_check_time | parseTime('{y}-{m}-{d} {h}:{i}:{s}')}}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>

import { subComma } from '@/utils'
export default {
  props: {
    list: Array,
    listLoading: Boolean
  },
  data() {
    return {
      check_str: ''
    }
  },
  created() {
    // this.getList()
  },
  methods: {
    handleSelectionChange(val) {
      var str = ''
      for (const v of val) {
        str += v.id + ','
      }
      this.check_str = subComma(str)
    },
    getThis() {
      this.$emit('get-order', this.check_str)
    }
  }
}
</script>
